package com.koudai.reader.util;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.content.Context;
import android.content.SharedPreferences;

public class SearchcountUtil {

    private static SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
    
    public static boolean isReachtoLimit(Context context){
        SharedPreferences config = context.getSharedPreferences("config", 0);
        
        
        String today = df.format(new Date());
        int searchcount = config.getInt(today, 0);
        config.edit().putInt(today, searchcount + 1).commit();
        
        if (searchcount > 3) {
            return true;
        } else {
            return false;
        }
        // 
        
    }
}
